//package com.duqc.rocketmq;
//
//import lombok.Data;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.rocketmq.client.exception.MQClientException;
//import org.apache.rocketmq.client.producer.DefaultMQProducer;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
//import org.springframework.boot.context.properties.ConfigurationProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * @ClassName MQProducerConfigure
// * @Description 生产者配置(canal 1.1.1版本之后, 默认支持将canal server接收到的binlog数据直接投递到MQ)
// * @Author duqc
// * @Date 2021/4/12
// **/
//@Data
//@Slf4j
////@Configuration
//@ConfigurationProperties(prefix = "rocketmq.producer")
//public class MQProducerConfigure {
//
//    /**
//     * groupName
//     */
//    private String groupName;
//    /**
//     * nameserver地址
//     */
//    private String namesrvAddr;
//    /**
//     * 消息最大长度
//     */
//    private Integer maxMessageSize;
//    /**
//     * 发送消息超时时间
//     */
//    private Integer sendMsgTimeOut;
//    /**
//     * 发送消息失败重试次数
//     */
//    private Integer retryTimesWhenSendFailed;
//
//    /**
//     * MQ 生产者配置
//     *
//     * @return
//     * @throws MQClientException
//     */
////    @Bean
//    @ConditionalOnProperty(prefix = "rocketmq.producer", value = "isOnOff", havingValue = "on")
//    public DefaultMQProducer defaultMQProducer() throws MQClientException {
//        log.info("defaultProducer 正在创建---------------------------------------");
//        DefaultMQProducer producer = new DefaultMQProducer(groupName);
//        producer.setNamesrvAddr(namesrvAddr);
//        producer.setVipChannelEnabled(false);
//        producer.setMaxMessageSize(maxMessageSize);
//        producer.setSendMsgTimeout(sendMsgTimeOut);
//        producer.setRetryTimesWhenSendFailed(retryTimesWhenSendFailed);
//
//        producer.start();
//        log.info("rocketmq producer server 开启成功----------------------------------");
//        return producer;
//    }
//
//
//}
